package com.ktwlsoft.archivemanage.domain.business.repositoryService.customAnalysis;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.ktwlsoft.archivemanage.payload.customAnalysis.GetDetailsResult;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ktwlsoft.archivemanage.domain.dao.repository.customAnalysis.ICustomAnalysisMapper;
import com.ktwlsoft.archivemanage.domain.dao.entity.customAnalysis.CustomAnalysis;

/**
 * custom_analysis--自助分析业务层接口实现类
 *
 * @author zhuhe on 2019-11-27 15:32:01
 * @version 1.0
 */
@Service("ICustomAnalysisService")
public class CustomAnalysisRepositoryService {
	
	private final ICustomAnalysisMapper customAnalysisMapper;

	public CustomAnalysisRepositoryService(ICustomAnalysisMapper customAnalysisMapper) {
		this.customAnalysisMapper = customAnalysisMapper;
	}

	/**
 	 * 查询分页 on 2019-11-27 15:32:01
 	 * @param pn 第几页
     * @param pageSize 每页多少条
 	 * @param customAnalysis customAnalysis
 	 * @return PageInfo<CustomAnalysis>
 	 */
	public PageInfo<CustomAnalysis> findPage(int pn,int pageSize,CustomAnalysis customAnalysis) {
		PageHelper.startPage(pn,pageSize);
		PageInfo<CustomAnalysis> pageInfo = new PageInfo<CustomAnalysis>(customAnalysisMapper.findList(customAnalysis));
		return pageInfo;
	}

	/**
	 * 查询分页 on 2019-11-27 15:32:01
	 * @param pn 第几页
	 * @param pageSize 每页多少条
	 * @param customAnalysis customAnalysis
	 * @return PageInfo<CustomAnalysis>
	 */
	public PageInfo<CustomAnalysis> findPage(int pn,int pageSize,JSONObject customAnalysis) {
		PageHelper.startPage(pn,pageSize);
		PageInfo<CustomAnalysis> pageInfo = new PageInfo<CustomAnalysis>(customAnalysisMapper.findListJson(customAnalysis));
		return pageInfo;
	}

    /**
	 * 查询集合 on 2019-11-27 15:32:01
	 * @param customAnalysis customAnalysis
	 * @return List<CustomAnalysis>
	 */
	public List<CustomAnalysis> findList(CustomAnalysis customAnalysis) {
		return customAnalysisMapper.findList(customAnalysis);
	}

    /**
	 * 根据ID查询信息 on 2019-11-27 15:32:01
	 * @param id	主键
	 * @return CustomAnalysis
	 */
	public CustomAnalysis getById(Long id){
		return customAnalysisMapper.getById(id);
	}

	/**
	 * 自助分析详情 on 2019/12/3 10:19
	 *
	 * @param id id
	 * @return Result<?>
	 */
	public GetDetailsResult getDetails(Long id){
		return customAnalysisMapper.getDetails(id);
	}

   /**
	 * 新增 on 2019-11-27 15:32:01
	 * @param customAnalysis customAnalysis
	 * @return int
	 */
	public int insert(CustomAnalysis customAnalysis){
		return customAnalysisMapper.insert(customAnalysis);
	}

   /**
	 * 修改 on 2019-11-27 15:32:01
	 * @param customAnalysis customAnalysis
	 * @return int
	 */
	public int update(CustomAnalysis customAnalysis){
		return customAnalysisMapper.update(customAnalysis);
	}

   /**
	 * 根据id集合批量删除信息 on 2019-11-27 15:32:01
	 * @param customAnalysisArr	主键编号集合
	 * @return int
	 */
	public int deleteByIds(List<Long> customAnalysisArr){
		return customAnalysisMapper.deleteByIds(customAnalysisArr);
	}

   /**
	 * 根据id删除信息 on 2019-11-27 15:32:01
	 * @param id id
	 * @return int
	 */
	public int deleteById(Long id){
		return customAnalysisMapper.deleteById(id);
	}

	/**
	  * 获取图表编号 on 2019/11/27 16:51
	  *
	  * @return CustomAnalysis
	  */
	public String getChartNum(){
		return customAnalysisMapper.getChartNum();
	}

	/**
	  * 获取业务检查得分数据 on 2019/11/28 15:21
	  *
	  * @param jsonObject jsonObject
	  * @return List<JSONObject>
	  */
	public List<JSONObject> getGuidanceScoreData(JSONObject jsonObject){
		return customAnalysisMapper.getGuidanceScoreData(jsonObject);
	}

	/**
	 * 获取整改后得分数据 on 2019/11/28 15:21
	 *
	 * @param jsonObject jsonObject
	 * @return List<JSONObject>
	 */
	public List<JSONObject> getMendMarkData(JSONObject jsonObject){
		return customAnalysisMapper.getMendMarkData(jsonObject);
	}

	/**
	  * 获取业务检查单量数据 on 2019/11/29 9:21
	  *
	  * @param jsonObject jsonObject
	  * @return List<JSONObject>
	  */
	public List<JSONObject> getGuidanceSingleNumData(JSONObject jsonObject){
		return customAnalysisMapper.getGuidanceSingleNumData(jsonObject);
	}

	/**
	  * 获取检查整改单量数据 on 2019/11/29 9:39
	  *
	  * @param jsonObject jsonObject
	  * @return List<JSONObject>
	  */
	public List<JSONObject> getMendSingleNumData(JSONObject jsonObject){
		return customAnalysisMapper.getMendSingleNumData(jsonObject);
	}

	/**
	  * 获取立档单位数量数据 on 2019/11/29 9:55
	  *
	  * @param jsonObject jsonObject
	  * @return List<JSONObject>
	  */
	public List<JSONObject> getArchiveUnitNumData(JSONObject jsonObject){
		return customAnalysisMapper.getArchiveUnitNumData(jsonObject);
	}

	/**
	  * 获取检查整改次数数据 on 2019/11/29 11:04
	  *
	  * @param jsonObject jsonObject
	  * @return List<JSONObject>
	  */
	public List<JSONObject> getMendNumData(JSONObject jsonObject){
		return customAnalysisMapper.getMendNumData(jsonObject);
	}

	/**
	  * 指标缺陷次数 on 2019/11/29 11:23
	  *
	  * @param jsonObject jsonObject
	  * @return List<JSONObject>
	  */
	public List<JSONObject> getIndexDefectNumData(JSONObject jsonObject){
		return customAnalysisMapper.getIndexDefectNumData(jsonObject);
	}
}
